import type { RouteRecordRaw } from 'vue-router';
import { basicRouteMap } from './router-modules';

export default [
  {
    path: '/dashboard',
    redirect: '/dashboard/index',
    name: 'Dashboard',
    meta: {
      title: '仪表盘',
      icon: 'DashboardOutlined'
    },
    component: basicRouteMap.RouteView,
    children: [
      {
        path: '/dashboard/index',
        name: 'DashboardIndex',
        component: () => import('@/views/dashboard/index.vue'),
        meta: {
          title: '分析页'
        }
      }
    ]
  },
  {
    path: '/link',
    redirect: '/link/iframe',
    name: 'Link',
    meta: {
      title: '链接',
      icon: 'LinkOutlined'
    },
    component: basicRouteMap.RouteView,
    children: [
      {
        path: '/link/iframe',
        name: 'LinkIframe',
        component: basicRouteMap.Iframe,
        meta: {
          title: 'AntDesign',
          url: 'https://ant.design/'
        }
      },
      {
        path: '/link/antdv',
        name: 'LinkAntdv',
        component: basicRouteMap.Iframe,
        meta: {
          title: 'AntDesignVue',
          url: 'https://antdv.com/'
        }
      },
      {
        path: 'https://www.baidu.com',
        name: 'LinkExternal',
        meta: {
          title: '跳转百度'
          // target: '_self',
        }
      }
    ]
  },
  {
    path: '/menu',
    redirect: '/menu/menu1',
    name: 'Menu',
    meta: {
      title: '菜单',
      icon: 'BarsOutlined'
    },
    component: basicRouteMap.RouteView,
    children: [
      {
        path: '/menu/menu1',
        name: 'MenuMenu11',
        component: () => import('@/views/menu/menu1.vue'),
        meta: {
          title: '菜单1'
        }
      },
      {
        path: '/menu/menu2',
        name: 'MenuMenu12',
        component: () => import('@/views/menu/menu2.vue'),
        meta: {
          title: '菜单2'
        }
      },
      {
        path: '/menu/menu3',
        redirect: '/menu/menu3/menu1',
        name: 'MenuMenu1-1',
        meta: {
          title: '菜单1-1'
        },
        children: [
          {
            path: '/menu/menu3/menu1',
            name: 'MenuMenu111',
            component: () => import('@/views/menu/menu-1-1/menu1.vue'),
            meta: {
              title: '菜单1-1-1'
            }
          },
          {
            path: '/menu/menu3/menu2',
            name: 'MenuMenu112',
            component: () => import('@/views/menu/menu-1-1/menu2.vue'),
            meta: {
              title: '菜单1-1-2'
            }
          }
        ]
      }
    ]
  },
  {
    path: '/exception',
    redirect: '/exception/403',
    name: 'Exception',
    meta: {
      title: '异常页',
      icon: 'WarningOutlined'
    },
    children: [
      {
        path: '/exception/403',
        name: 'Exception403',
        component: () => import('@/views/exception/403.vue'),
        meta: {
          title: '403'
        }
      },
      {
        path: '/exception/404',
        name: 'Exception404',
        component: () => import('@/views/exception/404.vue'),
        meta: {
          title: '404'
        }
      },
      {
        path: '/exception/500',
        name: 'Exception500',
        component: () => import('@/views/exception/500.vue'),
        meta: {
          title: '500'
        }
      }
    ]
  }
] as RouteRecordRaw[];
